package com.fanhang.samples.spring.hibernate.dao.impl;

import org.springframework.orm.hibernate4.support.HibernateDaoSupport;
import org.springframework.stereotype.Repository;

import com.fanhang.samples.spring.hibernate.dao.EmployeeDao;


@Repository
public class EmployeeDaoImpl extends HibernateDaoSupport implements EmployeeDao {
	
//	@Override
//	public int save(Employee model) {
//		String sql = "insert into employee(id,name,birthday,status) values(:id, :name, :birthday, :status)";
//		return super.update(sql, model);
//	}
//
//	@Override
//	public int delete(Integer id) {
//		String sql = "SELECT * FROM employee WHERE id = ?";
//		return super.update(sql, id);
//	}
//
//	@Override
//	public int update(Employee model) {
//		String sql = "update employee set name=:name,birthday=:birthday,status=:status WHERE id = :id";
//		return this.jdbcTemplate.update(sql, new BeanPropertySqlParameterSource(model));
//	}
//
//	@Override
//	public Employee get(Integer id) {
//		String sql = "SELECT * FROM employee WHERE id = ?";
//		return super.getJdbcTemplate().queryForObject(sql, new Integer[]{id}, Employee.class);
//	}
//
//	@Override
//	public List<Employee> getList(Employee model) {
//		String sql = "SELECT * FROM employee WHERE name like  = ?";
//		return this.jdbcTemplate.queryForList(sql, new BeanPropertySqlParameterSource(model), Employee.class);
//	}
	
}
